/**
 * 
 */
package tp8.tsh.stream;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;

/**
 * @author tpana
 * 
 */
public class StreamGobbler {
	
	private InputStream is;
	private PrintStream out;
	private String type;

	public StreamGobbler(InputStream is, PrintStream out, String type) {
		this.is = is;
		this.out = out;
		this.type = type;
	}

	public void run() {
		try {
			InputStreamReader isr = new InputStreamReader(is);
			BufferedReader br = new BufferedReader(isr);
			String line = null;
			while ((line = br.readLine()) != null) {
				out.println(line);
			}
		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
	
}
